﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>Read Later Background Page</title>
	<script src="js/readability.js" type="text/javascript"></script>
	<script src="js/process.js" type="text/javascript"></script>
	<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery.dateFormat-1.0.js"></script>
	<script type="text/javascript" src="js/md5.js"></script>
	<script src="js/bg.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/sync.js"></script>
	<script type="text/javascript">
		var ID_1 = chrome.contextMenus.create({
			title:'Read later',
			onclick:util.page,
			contexts:['page']
		});
		
		var ID_2 = chrome.contextMenus.create({
			title:'Read this link later',
			onclick:util.link,
			contexts:['link']
		});
		
		function UnLoadEvent(){
			chrome.contextMenus.remove(ID_1);
			chrome.contextMenus.remove(ID_2);
		}
		
		if(!localStorage['searcho'] || localStorage['searcho']<2){
			// window.open(chrome.extension.getURL('ad.html'));
			window.open("https://www.diigo.com/promotion/read_later_fast.html")
			localStorage['searcho'] =2;
		}
		
		localStorage['version'] = '1.3.8';

		if(!localStorage['userID']){
         	var u1 = getTime.getUTCInt();
            var u2 = parseInt(Math.random()*10+1);
            var u3 = ''+u1+u2;
            var userid = hex_md5(u3);
            console.log(userid);
            localStorage['userID']=userid;
	    }
	    if(!localStorage['shortcuts']){
			var shortcuts = '{"enable":0,"value":"L"}';
			localStorage['shortcuts']=shortcuts;
		}
		
		if(!localStorage['saveclosetab']){
			var saveclosetab = '{"enable":0}';
			localStorage['saveclosetab'] = saveclosetab;
		}

		if(!localStorage['superfish']){
			var superfish = '{"enable":1}';
			localStorage['superfish'] = superfish;
		}

	</script>
</head>
<body onunload="UnLoadEvent()" >
	
</body>
</html>